package com.sc.design.proxy.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class Client {
    public static void main(String[] args) {
        IGamePlayer gamePlayer = new GamePlayer("sc");
        InvocationHandler invocationHandler = new MyInvokeHandler(gamePlayer);
        IGamePlayer proxy = DynamicProxy.newProxyInstance(gamePlayer.getClass().getClassLoader(),gamePlayer.getClass().getInterfaces(),invocationHandler);
        proxy.killBoss();
    }
}
